package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppUserCollectMapper;
import com.ruoyi.system.domain.AppUserCollect;
import com.ruoyi.system.service.IAppUserCollectService;

import javax.annotation.Resource;

/**
 * 用户收藏Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-27
 */
@Service
public class AppUserCollectServiceImpl extends ServiceImpl<AppUserCollectMapper, AppUserCollect> implements IAppUserCollectService
{

    @Resource
    private AppUserCollectMapper appUserCollectMapper;

    /**
     * 查询用户收藏
     * 
     * @param id 用户收藏主键
     * @return 用户收藏
     */
    @Override
    public AppUserCollect selectAppUserCollectById(Long id)
    {
        return appUserCollectMapper.selectAppUserCollectById(id);
    }

    /**
     * 查询用户收藏列表
     * 
     * @param appUserCollect 用户收藏
     * @return 用户收藏
     */
    @Override
    public List<AppUserCollect> selectAppUserCollectList(AppUserCollect appUserCollect)
    {
        return appUserCollectMapper.selectAppUserCollectList(appUserCollect);
    }

    /**
     * 新增用户收藏
     * 
     * @param appUserCollect 用户收藏
     * @return 结果
     */
    @Override
    public int insertAppUserCollect(AppUserCollect appUserCollect)
    {
        appUserCollect.setCreateTime(DateUtils.getNowDate());
        return appUserCollectMapper.insertAppUserCollect(appUserCollect);
    }

    /**
     * 修改用户收藏
     * 
     * @param appUserCollect 用户收藏
     * @return 结果
     */
    @Override
    public int updateAppUserCollect(AppUserCollect appUserCollect)
    {
        return appUserCollectMapper.updateAppUserCollect(appUserCollect);
    }

    /**
     * 批量删除用户收藏
     * 
     * @param ids 需要删除的用户收藏主键
     * @return 结果
     */
    @Override
    public int deleteAppUserCollectByIds(Long[] ids)
    {
        return appUserCollectMapper.deleteAppUserCollectByIds(ids);
    }

    /**
     * 删除用户收藏信息
     * 
     * @param id 用户收藏主键
     * @return 结果
     */
    @Override
    public int deleteAppUserCollectById(Long id)
    {
        return appUserCollectMapper.deleteAppUserCollectById(id);
    }

    /**
     *今日注册人数
     * @return 结果
     */
    @Override
    public int selectRegistTodayNum() {
        return appUserCollectMapper.selectRegistTodayNum();
    }

    /**
     * 用户人数
     *
     * @return 结果
     */
    @Override
    public int selectUserNum() {
        return appUserCollectMapper.selectUserNum();
    }
}
